export type EnumOption = {
	label: string;
	value: any;
	color?: any;
};

/**
 * 通过枚举值兑换字段值
 * @param options
 * @param value
 * @param defaultValue
 * @returns
 */
export const getEnumOptionsField = (
	options: Readonly<EnumOption[]>,
	field: keyof EnumOption,
	value: any,
	defaultValue?: string,
) => {
	return options.find((item) => item.value === value)?.[field] || defaultValue;
};

/** @description 资源信息-资源类型：1-目录 2-菜单 3-按钮 */
export const SYSTEM_RESOURCES_TYPE_OPTIONS = Object.freeze([
	{ label: "目录", value: "1" },
	{ label: "菜单", value: "2" },
	{ label: "按钮", value: "3" },
]);

/** @description 是否为叶子节点-是否为叶子节点：1-是 0-不是*/
export const IS_TLEAF_OPTIONS = Object.freeze([
	{ label: "是", value: "0" },
	{ label: "不是", value: "1" },
]);

/** @description 是否为路由菜单-是否为路由菜单：1-是 0-不是*/
export const IS_ROUTE_OPTIONS = Object.freeze([
	{ label: "是", value: "0" },
	{ label: "不是", value: "1" },
]);

/** @description 是否缓存页面-是否缓存页面：1-是 0-不是*/
export const IS_KEEPALIVE_OPTIONS = Object.freeze([
	{ label: "是", value: "0" },
	{ label: "不是", value: "1" },
]);

/** @description 删除状态-删除状态：1-已删除 0-正常*/
export const IS_DELETE_OPTIONS = Object.freeze([
	{ label: "正常", value: "0" },
	{ label: "已删除", value: "1" },
]);

/** @description 是否配置菜单的权限/是否隐藏路由菜单/是否隐藏Tab-是否配置菜单的权限：1-是 0-否*/
export const IS_RULEFLAG_OPTIONS = Object.freeze([
	{ label: "是", value: "1" },
	{ label: "否", value: "0" },
]);

/** @description 按钮权限状态-按钮权限状态：1-有效 0-无效*/
export const BUTTON_STATUS_OPTIONS = Object.freeze([
	{ label: "有效", value: "1" },
	{ label: "无效", value: "0" },
]);

/** @description 外链菜单打开方式-外链菜单打开方式：1-外部打开 0-内部打开*/
export const INTERNALOREXTERNAL_OPTIONS = Object.freeze([
	{ label: "外部打开", value: "1" },
	{ label: "内部打开", value: "0" },
]);


/** @description 菜单排序-菜单排序 0-一级菜单 1-子菜单 2-权限按钮 */
export const MENU_SORT_OPTIONS = Object.freeze([
	{ label: "一级菜单", value: "0" },
	{ label: "子菜单", value: "1" },
	{ label: "权限按钮", value: "2" },
]);

/** @description 权限策略-权限策略：1-显示 2-禁用*/
export const PERMS_TYPE_OPTIONS = Object.freeze([
	{ label: "显示", value: "1" },
	{ label: "禁用", value: "2" }
]);

/** @description 用户信息-在职状态：1-在职 0-离职 */
export const SYSTEM_USER_DUTY_STATUS_OPTIONS = Object.freeze([
	{ label: "在职", value: "1" },
	{ label: "离职", value: "0" },
]);

/** @description 用户信息-用户类型：1-企业用户 2-园区用户 3-第三方单位ID */
export const SYSTEM_USER_TYPE_OPTIONS = Object.freeze([
	{ label: "企业用户", value: "1" },
	{ label: "园区用户", value: "2" },
	{ label: "第三方单位", value: "3" },
]);

/** @description 用户信息-工种：1-特种作业 2-安全管理人员 3-危险化学品作业人员 4-剧毒化学品作业人员 */
export const SYSTEM_USER_WORKER_TYPE_OPTIONS = Object.freeze([
	{ label: "特种作业", value: "1" },
	{ label: "安全管理人员", value: "2" },
	{ label: "危险化学品作业人员", value: "3" },
	{ label: "剧毒化学品作业人员", value: "4" },
]);

/** @description 事故事件管理-事故类型:1-泄漏 2-爆炸 3-火灾 4-其他类型 */
export const ACCIDENT_TYPE_OPTIONS = Object.freeze([
	{ label: "泄漏", value: "1" },
	{ label: "爆炸", value: "2" },
	{ label: "火灾", value: "3" },
	{ label: "其他类型", value: "4" },
]);

/** @description 文章管理-文章类型：1-宣传栏 0-考试培训 */
export const ARTICLE_TYPE_OPTIONS = Object.freeze([
	{ label: "宣传栏", value: "1" },
	{ label: "考试培训", value: "0" },
]);

/** @description 文章管理学习统计-是否达标：1-已达标 0-未达标 */
export const ARTICLE_STUDY_STATISTIC_HAS_QUALIFY_OPTIONS = Object.freeze([
	{ label: "已达标", value: "1" },
	{ label: "未达标", value: "0" },
]);

/** @description 文章管理-是否已学习：1-已学习 0-微学习 */
export const ARTICLE_WORK_LEARNED_OPTIONS = Object.freeze([
	{ label: "已学习", value: "1" },
	{ label: "未学习", value: "0" },
]);

/** @description 检查计划-检查类型：1-日常检查 2-专项检查 3-重要节假日活动 4-其他 */
export const CHECK_PLAN_TYPE_OPTIONS = Object.freeze([
	{ label: "日常检查", value: "1" },
	{ label: "专项检查", value: "2" },
	{ label: "重要节假日活动", value: "3" },
	{ label: "其他", value: "4" },
]);

/** @description 安全承诺书-安全风险等级:1-重大风险 2-较大风险 3-一般风险 0-低风险 */
export const COMMITMENT_LEVEL_OPTIONS = Object.freeze([
	{ label: "重大风险", value: "1" },
	{ label: "较大风险", value: "2" },
	{ label: "一般风险", value: "3" },
	{ label: "低风险", value: "0" },
]);

/** @description 安全承诺书-承诺类别：1-每日安全承诺 2-年初承诺 3-年度履诺报告 */
export const COMMITMENT_TYPE_OPTIONS = Object.freeze([
	{ label: "每日安全承诺", value: "1" },
	{ label: "年初承诺", value: "2" },
	{ label: "年度履诺报告", value: "3" },
]);

/** @description 安全承诺企业现状-有无重大隐患：1-有 0-无 */
export const COMMITMENT_EVERY_DAY_HAS_DANGER_OPTIONS = Object.freeze([
	{ label: "有", value: "1" },
	{ label: "无", value: "0" },
]);

/** @description 信用信息报送-报送状态：1-已报送 0-未报送 */
export const CREDIT_INFO_REPORT_REPORT_STATUS_OPTIONS = Object.freeze([
	{ label: "已报送", value: "1" },
	{ label: "未报送", value: "0" },
]);

/** @description 信用信息报送-信用信息类型：1-行政许可 0-行政处罚 */
export const CREDIT_INFO_REPORT_TYPE_OPTIONS = Object.freeze([
	{ label: "行政许可", value: "1" },
	{ label: "行政处罚", value: "0" },
]);

/** @description 重大危险源-危险源等级：1-一级 2-二级 3-三级 4-四级 0-非重大 */
export const DANGER_SOURCE_LEVEL_OPTIONS = Object.freeze([
	{ label: "一级", value: "1" },
	{ label: "二级", value: "2" },
	{ label: "三级", value: "3" },
	{ label: "四级", value: "4" },
	{ label: "非重大", value: "0" },
]);

/** @description 重大危险源-重大危险源：1-储罐区 2-库区 3-生产场所 4-压力管道 5-锅炉 6-压力容器 */
export const DANGER_SOURCE_SOURCE_OPTIONS = Object.freeze([
	{ label: "储罐区", value: "1" },
	{ label: "库区", value: "2" },
	{ label: "生产场所", value: "3" },
	{ label: "压力管道", value: "4" },
	{ label: "锅炉", value: "5" },
	{ label: "压力容器", value: "6" },
]);

/** @description 企业-经济类型：1-私营经济 2-国有经济 3-股份制 */
export const ENTERPRISE_ECONOMIC_TYPE_OPTIONS = Object.freeze([
	{ label: "私营经济", value: "1" },
	{ label: "国有经济", value: "2" },
	{ label: "股份制", value: "3" },
]);

/** @description 企业-是否进入黑名单:1-是 0-否 */
export const ENTERPRISE_IN_BLACKLIST_OPTIONS = Object.freeze([
	{ label: "是", value: "1" },
	{ label: "否", value: "0" },
]);

/** @description 企业-所属行业：1-生产制造业 2-储存与批发零售 3-运输业 4-使用与处置 */
export const ENTERPRISE_INDUSTRY_OPTIONS = Object.freeze([
	{ label: "生产制造业", value: "1" },
	{ label: "储存与批发零售", value: "2" },
	{ label: "运输业", value: "3" },
	{ label: "使用与处置", value: "4" },
]);

/** @description 企业-诚信等级：1-优 2-良 3-中等 4-差 */
export const ENTERPRISE_INTEGRITY_LEVEL_OPTIONS = Object.freeze([
	{ label: "优", value: "1" },
	{ label: "良", value: "2" },
	{ label: "中等", value: "3" },
	{ label: "差", value: "4" },
]);

/** @description 企业-监管分类：1-一般监督 2-终点关注 3-特别监管 */
export const ENTERPRISE_SUPERVISE_TYPE_OPTIONS = Object.freeze([
	{ label: "一般监督", value: "1" },
	{ label: "重点关注", value: "2" },
	{ label: "特别监管", value: "3" },
]);

/** @description 装置开停车和大检修管理-状态：1-正常 0-冲突预警 */
export const EQP_CHECK_STATUS_OPTIONS = Object.freeze([
	{ label: "正常", value: "1" },
	{ label: "冲突预警", value: "0" },
]);

/** @description 装置开停车和大检修管理-类别:1-装置开停车 2-大检修 */
export const EQP_CHECK_TYPE_OPTIONS = Object.freeze([
	{ label: "装置开停车", value: "1" },
	{ label: "大检修", value: "2" },
]);

/** @description 设备-设备状态：1-正常 2-停用 3-检修 */
export const EQP_STATUS_OPTIONS = Object.freeze([
	{ label: "正常", value: "1" },
	{ label: "停用", value: "2" },
	{ label: "检修", value: "3" },
]);

/** @description 类型-类型：0-一级菜单 1-子菜单 2-按钮权限 */
export const TYPE_OPTIONS = Object.freeze([
	{ label: "一级菜单", value: "0" },
	{ label: "子菜单", value: "1" },
	{ label: "按钮权限", value: "2" },
]);

/** @description 评价评估报告-报告类型：1-定性评估报告 2-定量评估报告 3-综合评估报告 4-定期评估报告 5-专项评估报告 */
export const EVALUATE_REPORT_REPORT_TYPE_OPTIONS = Object.freeze([
	{ label: "定性评估报告", value: "1" },
	{ label: "定量评估报告", value: "2" },
	{ label: "综合评估报告", value: "3" },
	{ label: "定期评估报告", value: "4" },
	{ label: "专项评估报告", value: "5" },
]);

/** @description 评价评估报告-设备有效性：1-有效 0-无效 */
export const FIRE_EQP_EQP_VALIDITY_OPTIONS = Object.freeze([
	{ label: "有效", value: "1" },
	{ label: "无效", value: "0" },
]);

/** @description 园区网格_巡检记录-设备有效性：1-有效 0-无效 */
export const PARK_GRID_PATROL_RECORD_EQP_VALIDITY_OPTIONS = Object.freeze([
	{ label: "有效", value: "1" },
	{ label: "无效", value: "0" },
]);

/** @description 园区网格_巡检记录-巡查状态：1-已完成 0-未完成 */
export const PARK_GRID_PATROL_RECORD_PATROL_STATUS_OPTIONS = Object.freeze([
	{ label: "已完成", value: "1" },
	{ label: "未完成", value: "0" },
]);

/** @description 园区网格_巡查模版_成员表-成员类型：1-队长 0-成员 */
export const PARK_GRID_PATROL_TMP_USER_USER_TYPE_OPTIONS = Object.freeze([
	{ label: "队长", value: "1" },
	{ label: "成员", value: "0" },
]);

/** @description 风险隐患管理-隐患来源:1-日常检查 2-专项检查 3-重要节假日活动 4-其他 5-随手拍 */
export const RISK_HAZARDS_DATA_SOURCE_OPTIONS = Object.freeze([
	{ label: "日常检查", value: "1" },
	{ label: "专项检查", value: "2" },
	{ label: "重要节假日活动", value: "3" },
	{ label: "其他", value: "4" },
	{ label: "随手拍", value: "5" },
]);

/** @description 风险隐患管理-隐患级别：1-一般隐患 2-重大隐患 */
export const RISK_HAZARDS_LEVEL_OPTIONS = Object.freeze([
	{ label: "一般隐患", value: "1" },
	{ label: "重大隐患", value: "2" },
]);

/** @description 风险隐患管理_隐患复查-复查结果状态：1-复查通过 0-复查驳回 */
export const RISK_HAZARDS_CHECK_CHECK_STATUS_OPTIONS = Object.freeze([
	{ label: "复查通过", value: "1" },
	{ label: "复查驳回", value: "0" },
]);

/** @description 风险隐患管理_风险管控-风险状态:1-管控中 0-已解除 */
export const RISK_HAZARDS_CONTROL_DANGER_STATUS_OPTIONS = Object.freeze([
	{ label: "管控中", value: "1" },
	{ label: "已解除", value: "0" },
]);

/** @description 风险隐患管理_风险管控-是否有预警提醒：1-是 0-否 */
export const RISK_HAZARDS_CONTROL_HAS_WARING_OPTIONS = Object.freeze([
	{ label: "是", value: "1" },
	{ label: "否", value: "0" },
]);

/** @description 风险隐患管理_隐患详情-上报处理状态：0-待处理 1-已处理 */
export const RISK_HAZARDS_HANDLE_STATUS_OPTIONS = Object.freeze([
	{ label: "待处理", value: "0" },
	{ label: "已处理", value: "1" },
]);

/** @description 风险隐患管理_隐患详情-督办整改状态：1-待复查 2-待整改 3-逾期未整改 4-已完成 */
export const RISK_HAZARDS_SUPERVISION_STATUS_OPTIONS = Object.freeze([
	{ label: "待复查", value: "1" },
	{ label: "待整改", value: "2" },
	{ label: "逾期未整改", value: "3" },
	{ label: "已完成", value: "4" },
]);

/** @description 风险隐患管理_特殊作业报备变更状态-作业状态：1-待施工 2-施工中 3-已验收 */
export const RISK_HAZARDS_SPECIAL_TASK_STATUS_OPTIONS = Object.freeze([
	{ label: "待施工", value: "1" },
	{ label: "施工中", value: "2" },
	{ label: "已验收", value: "3" },
]);

/** @description 风险隐患管理-作业类型：1-动火作业 2-受限空间作业 3-盲板抽堵作业 4-高处作业 5-吊装作业 6-临时用电作业 7-动图作业 8-断路作业 */
export const RISK_HAZARDS_SPECIAL_TASK_TYPE_OPTIONS = Object.freeze([
	{ label: "动火作业", value: "1" },
	{ label: "受限空间作业", value: "2" },
	{ label: "盲板抽堵作业", value: "3" },
	{ label: "高处作业", value: "4" },
	{ label: "吊装作业", value: "5" },
	{ label: "临时用电作业", value: "6" },
	{ label: "动图作业", value: "7" },
	{ label: "断路作业", value: "8" },
]);

/** @description 第三方单位-审核结果：2-审核通过 3-审核驳回 */
export const THIRD_UNIT_AUDIT_STATUS_OPTIONS = Object.freeze([
	{ label: "审核通过", value: "2" },
	{ label: "审核驳回", value: "3" },
]);

/** @description 第三方单位-状态：1-待审核 2-已通过 3-已驳回 */
export const THIRD_UNIT_STATUS_OPTIONS = Object.freeze([
	{ label: "待审核", value: "1", color: "#00B145" },
	{ label: "已通过", value: "2", color: "#1D2129" },
	{ label: "已驳回", value: "3", color: "#E70000" },
]);

/** @description 第三方单位-培训状态：1-已培训 0-未培训 */
export const THIRD_UNIT_TRAIN_STATUS_OPTIONS = Object.freeze([
	{ label: "已培训", value: "1" },
	{ label: "未培训", value: "0", color: "#E70000" },
]);

/** @description 第三方单位-资质等级：1-一级 2-二级 3-三级 */
export const THIRD_LEVEL_OPTIONS = Object.freeze([
	{ label: "特级", value: "0" },
	{ label: "一级", value: "1" },
	{ label: "二级", value: "2" },
	{ label: "三级", value: "3" },
]);

/** @description 危险化工工艺*/
export const DANGER_CRAFT_NAME_OPTIONS = Object.freeze([
	{ label: "光气及光气化工艺", value: "1" },
	{ label: "电解工艺（氯碱）", value: "2" },
	{ label: "硝化工艺", value: "3" },
	{ label: "合成氨工艺", value: "4" },
	{ label: "裂解（裂化）工艺", value: "5" },
	{ label: "氟化工艺", value: "6" },
	{ label: "加氢工艺", value: "7" },
	{ label: "重氮化工艺", value: "8" },
	{ label: "氧化工艺", value: "9" },
	{ label: "过氧化工艺", value: "10" },
	{ label: "胺基化工艺", value: "11" },
	{ label: "磺化工艺", value: "12" },
	{ label: "聚合工艺", value: "13" },
	{ label: "烷基化工艺", value: "14" },
]);

/** @description 危险化工工艺*/
export const DANGER_CHEMICAL_TYPE_OPTIONS = Object.freeze([
	{ label: "爆炸品", value: "1" },
	{ label: "压缩气体和液化气体", value: "2" },
	{ label: "易燃液体", value: "3" },
	{ label: "易燃固体、自燃物品和遇湿易燃物品", value: "4" },
	{ label: "氧化剂和有机过氧化物", value: "5" },
	{ label: "有毒物质", value: "6" },
	{ label: "腐蚀品", value: "7" },
]);

/** @description 试题类型：1-单选 2-多选 3-判断*/
export const EXAM_TYPE_OPTIONS = Object.freeze([
	{ label: "单选", value: "1" },
	{ label: "多选", value: "2" },
	{ label: "判断", value: "3" },
]);

/* 新增========================================================================================================== */

/** @description 企业端预约记录-申请类型：1-危化品车辆 2-车辆 3-员工 4-访客 */
export const RECORD_TYPE_OPTIONS = Object.freeze([
	{ label: "危化品车辆", value: 1 },
	{ label: "车辆", value: 2 },
	{ label: "员工", value: 3 },
	{ label: "访客", value: 4 },
]);

/** @description 企业端预约记录-申请状态：1-待审核 2-已撤回 3-已驳回 4-通过 */
export const RECORD_STATUS_OPTIONS = Object.freeze([
	{ label: "待审核", value: 1 },
	{ label: "已撤回", value: 2 },
	{ label: "已驳回", value: 3 },
	{ label: "通过", value: 4 },
]);

/** @description 道闸状态-申请状态：1-正常 2-损坏 3-停用 */
export const GATE_STATUS_OPTIONS = Object.freeze([
	{ label: "正常", value: 1 },
	{ label: "损坏", value: 2 },
	{ label: "停用", value: 3 },
]);

/** @description 考试场次-考试场次：1-正常 2-损坏 3-停用 */
export const EXAM_OPTIONS = Object.freeze([
	{ label: "运输人员考试场次01", value: 1 },
	{ label: "押运人员考试场次01", value: 2 },
	{ label: "装卸管理人员考试场次01", value: 3 },
]);

/** @description 所属企业-所属企业：1-正常 2-损坏 3-停用 */
export const COMPANY_OPTIONS = Object.freeze([
	{ label: "上港集团物流有限公司", value: "A05" },
	{ label: "大熊集团物流有限公司", value: "A04" }
]);

/** @description 预警处理状态：0-已处理 1-未处理 */
export const WARNING_STATUS_OPTIONS = Object.freeze([
	{ label: "已处理", value: 0 },
	{ label: "未处理", value: 1 },
]);

/** @description 停车场类别：1-空载区 2-重载区 */
export const PARKING_TYPE_OPTIONS = Object.freeze([
	{ label: "空载区", value: 1 },
	{ label: "重载区", value: 2 },
]);

/****************************************************************************************************/

/** @description 工种类型 */
export const WORK_TYPE_OPTIONS = Object.freeze([
	{ label: "运输人员", value: 1 },
	{ label: "押运人员", value: 2 },
	{ label: "装卸管理人员", value: 3 },
]);
export const STATUS_TYPE_OPTIONS = Object.freeze([
	{ label: "待审核", value: 1},
	{ label: "已拒绝", value: 2 },
	{ label: "已通过", value: 3 },
]);

/** @description 培训类别 */
export const COURSE_TYPE_OPTIONS = Object.freeze([
	{ label: "运输人员", value: "1" },
	{ label: "押运人员", value: "2" },
	{ label: "装卸管理人员", value: "3" },
]);
/** @description 考试状态 */
export const EXAME_TYPE_OPTIONS = Object.freeze([
	{ label: "未报名", value: "-1" },
	{ label: "未开始", value: "0" },
	{ label: "进行中", value: "1" },
  { label: "未通过", value: "2" },
  { label: "已通过", value: "3" },
]);


/** @description 人员状态 */
export const USER_TYPE_OPTIONS = Object.freeze([
	{ label: "冻结", value: 0 },
	{ label: "正常", value: 1 },
	{ label: "未审核", value: 2 },
]);

/** @description 题型 */
export const QUESTION_TYPE_OPTIONS = Object.freeze([
	{ label: "单选", value: "0" },
	{ label: "多选", value: "1" },
	{ label: "判断", value: "2" },
]);

/** @description 考试发布状态 */
export const EXAM_STATUS_OPTIONS = Object.freeze([
	{ label: "未发布", value: "0" },
	{ label: "已发布", value: "1" },
]);

/** @description 用户类型 */
export const ADMIN_TYPE_OPTIONS = Object.freeze([
	{ label: "管理员", value: "管理员" },
	{ label: "企业", value: "企业" },
	{ label: "移动", value: "移动" },
]);

/** @description 人员状态1 */
export const USER_TYPE_OPTIONS1 = Object.freeze([
	{ label: "冻结", value: "0" },
	{ label: "正常", value: "1" },
	{ label: "未审核", value: "2" },
]);

/****************************************************************************************************/
/** @description 培训计划-培训类型 */
export const TRAIN_TYPE_OPTIONS = Object.freeze([
	{ label: "运输人员", value: "1" },
  { label: "押运人员", value: "2" },
	{ label: "装卸管理人员", value: "3" }
]);

/** @description 培训计划-发布状态 */
export const FABU_STATUS_OPTIONS = Object.freeze([
	{ label: "已发布", value: "1" },
	{ label: "未发布", value: "0" }
]);